from flask_restplus import fields
from api.restplus import api

# 接受工程描述文件
preloading = api.model("Preloading", {
    "project": fields.String(required=False, description="工程参数."),
    "properties": fields.String(required=True, description="属性参数."),
})

# EnergyStorageCharacteristicsItem
EnergyStorageCharacteristicsItem = api.model("EnergyStorageCharacteristicsItem", {
    "year": fields.Integer(required=True, description="年数"),
    "batteryDecay": fields.Float(required=True, description="电池衰减"),
    "capacityDecay": fields.Float(required=True, description="容量衰减"),
})

# 储能特性
EnergyStorageCharacteristics = api.model("EnergyStorageCharacteristics",
                                         fields.Nested(EnergyStorageCharacteristicsItem, as_list=True))

# 仿真结果返回
preloading_res = api.model("Preloading_res", {
    "EnergyStorageCharacteristics": fields.Nested(EnergyStorageCharacteristics)
})
